﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrganizeItMax
{
    public class Engine
    {
        public static SortedList<string, File> GetFilesFromSources(string[] pSources, string[] pPatterns)
        {
            var tGatheredFiles = new SortedList<string, File>();

            foreach (var tPattern in pPatterns)
            {
                foreach (var tSource in pSources)
                {
                    var tFiles = System.IO.Directory.GetFiles(tSource, tPattern, System.IO.SearchOption.AllDirectories);

                    foreach (var tFile in tFiles)
                    {
                        tGatheredFiles.Add(tFile, new File(tFile));
                    }
                }
            }
            return tGatheredFiles;
        }
    }
}
